Skip to content

Add toggle control for socks5 proxy and password protection for socks5 outbounds like naive#1166

Open
IdiotEbrilo wants to merge 6 commits into
MatsuriDayo:mainfrom
IdiotEbrilo:add-proxy-controls-and-auth
Open

Add toggle control for socks5 proxy and password protection for socks5 outbounds like naive#1166
IdiotEbrilo wants to merge 6 commits into
MatsuriDayo:mainfrom
IdiotEbrilo:add-proxy-controls-and-auth

Conversation

@IdiotEbrilo

@IdiotEbrilo IdiotEbrilo commented Apr 14, 2026

Copy link
Copy Markdown

The first part of this PR extends PRs #1154 and #1158

To improve security and to simplify configurations a toggle control has been added to disable or enable socks5 mixed-in proxy at once. With it there's no more need to create socks5-specific routes or add custom JSON rules to prevent IP leaks, you just have to toggle it off, and there will be no more mixed-in inbound, no matter is it password-protected or not.

Active socks5 controls and mixed-in inbounds:

Контролы активные Инбаунды с mixed-in

Disabled socks5 controls and removed socks5 mixed-in proxy:

Контролы неактивные Инбаунды без mixed-in

The second part adds password protection to socks5 outbounds like naive since they currently don't use any credentials and are extremely vulnerable to IP detection mechanisms.

Current naive auto-generated section without credentials and sample of ip detection:

Исходный конфиг naive Определение внешнего ip с naive

Auto-generated naive sections with randomly generated credentials:

Конфиг naive с кредами

@IdiotEbrilo

Copy link
Copy Markdown
Author

Refactored UI a bit to make it more intuitive

Без имени Без имени1

@ropucyka

Copy link
Copy Markdown

Чел у тебя даже скрины косые и искренне не одупляешь, что что-то не так? Даже не представляю что ты мог наворотить хорошего в коде. "Юзернейм" - это мы на базаре? семки есть? а если найду?

hawkff added a commit to hawkff/NekoBoxForAndroid that referenced this pull request Jun 20, 2026
* feat(security): authenticate naive local SOCKS loopback (MatsuriDayo#1166 part 2)

Generate per-port credentials for the naive external-plugin SOCKS listener and
dial it from the sing-box socks outbound with the same creds. Android does not
isolate 127.0.0.1 per app, so an unauthenticated plugin SOCKS listener could be
reached by any local app to leak the egress IP. Verified on-device: the naive
SOCKS port now rejects unauthenticated connections (curl: 'No authentication
method was acceptable') and accepts with creds.

Scoped to naive only; other external plugins (mieru/trojan-go/hysteria v1) need
separate per-plugin auth verification before enabling.

* review: address Greptile feedback (skip creds on export, rename shadowed params)

- ConfigBuilder: gate naive loopback creds on !forExport so the exported sing-box
  config stays credential-free and matches the credential-free exported naive config
  (ProxyEntity.buildNaiveConfig), avoiding a broken standalone export.
- NaiveFmt: rename buildNaiveConfig params username/password -> listenUsername/
  listenPassword to stop shadowing NaiveBean.username/.password receiver properties.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants